package mysql

import "gorm.io/gorm"

type Goods struct {
	gorm.Model
	Name   string `gorm:"type:varchar(30);not null;comment: 商品名称"`
	Price  string `gorm:"type:decimal(10,2);not null;comment: 商品价格"`
	State  string `gorm:"type:varchar(30);not null;comment: 商品状态"`
	UserId int64  `gorm:"type:int(11);not null;comment: 用户ID"`
}

func (g *Goods) GoodAdd(db *gorm.DB) error {
	return db.Debug().Create(g).Error
}
